package com.king.cms.touch.action.admin;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.hibernate.InstantiationException;

import com.king.cms.action.BaseDispatchAction;
import com.king.cms.common.Constants;
import com.king.cms.db.QueryPage;

public class StaticContentListAction extends BaseDispatchAction{
	private static final Log  log = LogFactory.getLog(StaticContentListAction.class);
	/**
	 * Method execute
	 * 
	 * @param mapping
	 * @param form
	 * @param request
	 * @param response
	 * @return ActionForward
	 * @throws ServletException 
	 * @throws IllegalAccessException 
	 * @throws InstantiationException 
	 * @throws java.lang.InstantiationException 
	 */
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) throws ServletException { 
		 String moduleId = request.getParameter("module");
		
		 String sql = "select c.ID,c.MODULE_ID,c.MENU_ID,c.CONTENT_NAME,c.CONTENT_DESC from cms_touch_content c where c.MODULE_ID=" + moduleId + "";
		 QueryPage query = new QueryPage(request, request.getContextPath()+"/tadmin/staticList.do?module="+moduleId , sql);
		 
		 request.setAttribute("data", query);
		 request.setAttribute("module", moduleId);
		 return mapping.findForward("staticList");
	}
	}
